<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%
    String path = request.getContextPath();
    String basePath = request.getScheme()
            + "://" + request.getServerName()
            + ":" + request.getServerPort()
            + path + "/";
%>
<head>
    <title>首页</title>
    <link rel="stylesheet" href="<%=basePath%>css/base.css">
    <link rel="stylesheet" href="<%=basePath%>css/style.css">
</head>
<body>
<div class="header">
    <div class="head wrap">
        <div class="logo fl"><img src="<%=basePath%>upload/logo.png"></div>
        <div class="head-right fr">
            <div class="head-a fr" style="float: right;margin: 33px -158px 10px;">
                <div class="head-a3 login-click fl"><a href="#">登录</a></div>
                <div class="head-a4 reg-click fl"><a href="#">注册</a></div>
            </div>
            <%--<div class="clearfix"></div>--%>
            <div class="nav  fr" style="line-height: 90px;">
                <ul>
                    <li class="nav-cut"><a href="<%=basePath%>shixun/shouyeInfo">首页</a></li>
                    <li>
                        <a href="<%=basePath%>shixun/loginAgeFile">文章</a>
                    </li>
                    <li><a href="<%=basePath%>TestSX/getuserTieziaAtion">社区</a></li>
                    <li><a href="<%=basePath%>user/lianxi.jsp">联系我们</a></li>
                </ul>
            </div>
            <h3 id="sixTishi">${requestScope.sixTishi}</h3>
            <div class="clearfix"></div>
        </div>
    </div>
</div>


<div class="content">
    <div class="idx-banner">
        <div class="fullSlide">
            <div class="box">
                <ul>
                    <li style="background:url(<%=basePath%>upload/ban3.png) no-repeat center center;margin-top: 95px;width: 100%;">
                        <a href="javascript:;"></a></li>
                    <li style="background:url(<%=basePath%>upload/ban1.png) no-repeat center center;margin-top: 95px;width: 100%;">
                        <a href="javascript:;"></a></li>
                    <li style="background:url(<%=basePath%>upload/ban2.png) no-repeat center center;margin-top: 95px;width: 100%;">
                        <a href="javascript:;"></a></li>
                </ul>
            </div>
            <div class="hbox">
                <ul></ul>
            </div>
        </div>
    </div>

    <div class="wrap">
        <br/>
        <br/>
        <br/>
        <br/>
        <div class="focus-b-box">
            <div class="focus-list">
                <div class="focus-title">文章推荐</div>
            </div>
            <div class="focus-b">
                <ul class="focus-ul">
                    <c:forEach items="${sixInfo}" var="file" begin="0" varStatus="status">
                        <li>
                            <div class="focu-b1"><img src="<%=basePath%>upload/${status.index}.jpg"></div>
                                <%--<div class="focu-b1"><img src="<%=basePath%>upload/focus-b.jpg"></div>--%>
                            <div class="focu-b2">文章主题：<span>${file.fname}</span></div>
                            <div class="focu-b3">文章发布人：<span>${file.userEntity.name}</span></div>
                            <div class="focu-b4"><a href="<%=basePath%>shixun/ageXiangXi?fileid=${file.id}">点击查看</a></div>
                        </li>
                    </c:forEach>
                </ul>
            </div>
            <%--<div class="page">--%>
                <%--<a href="" class="page-cut">1</a>--%>
                <%--<a href="">2</a>--%>
                <%--<a href="">》</a>--%>
            <%--</div>--%>
        </div>
    </div>
    <h1 hidden id="tishi">${fubtishi}</h1>
    <jsp:include page="foot/foot.jsp"/>

    <div class="mask"></div>
    <div class="login">
        <div class="login-title">
            <div class="login-a">登录</div>
            <div class="login-b"></div>
            <div class="login-c close">x</div>
        </div>
        <div class="login-btm">
            <form action="<%=basePath%>TestSX/userLogin" method="post">
                <div class="login-d"><input type="text" id="userName" name="userEntity.loginId" class="login-text"
                                            placeholder="登录账号"></div>
                <div class="login-d"><input type="password" id="userPass" name="userEntity.loginPass" class="login-pas"
                                            placeholder="登录密码"></div>
                <div class="login-d"><input type="submit" style="color: white;width: 270px" class="login-btn"
                                            onclick="return userlogin()" value="登录"></div>
                <div class="login-f">
                    <a href="">忘记密码</a>
                    <span>还没有焦点账号?><a href="javascript:;" class="reg-href">点击注册</a></span>
                </div>
            </form>
        </div>
    </div>

    <div class="reg" style="height: 410px; ">
        <div class="login-title">
            <div class="login-a">注册</div>
            <div class="login-b"></div>
            <div class="login-c close">x</div>
        </div>
        <div class="login-btm" style="margin-left: 8px">
            <form action="<%=basePath%>TestSX/userRegister" method="post">
                <div class="login-d"><input type="text" class="login-text" id="userLoginId" placeholder="登录号"
                                            name="userEntity.loginId" id="loginId"></div>
                <div class="login-d"><input type="text" class="login-text" placeholder="用户昵称" name="userEntity.name"
                                            id="name"></div>
                <div class="login-d"><input type="password" class="login-pas" id="userLoginPass" placeholder="登陆密码"
                                            name="userEntity.loginPass" id="loginPass"></div>
                <div class="login-d"><input type="text" class="login-text" placeholder="性别" name="userEntity.sex"
                                            id="sex"></div>
                <div class="login-d"><input type="text" class="login-text" placeholder="年龄" name="userEntity.age"></div>
                <div class="login-d"><input type="text" class="login-text" placeholder="邮箱/手机号" name="userEntity.email"
                                            id="email"></div>
                <div class="login-d"><input type="submit" style="color: white;width: 270px" class="login-btn"
                                            onclick="return userzhuce()" value="注册"></div>
            </form>
        </div>
    </div>
    <h1 id="fubtishi">${fubtishi}</h1>

    <script src="<%=basePath%>js/jquery-1.11.1.min.js"></script>
    <script src="<%=basePath%>js/jquery.SuperSlide.2.1.1.js"></script>
    <script src="<%=basePath%>js/Action.js"></script>

    <%--首页文章信息的遍历--%>
    <script>
//        无效用户
        $(document).ready(function () {
            var $tishi = $("#sixTishi").text();
            if ($tishi == ""){
            }else {
                alert($tishi);
                $("#sixTishi").html("");
            }
        })
    </script>
    <script type="text/javascript">
        //提示信息
        $(document).ready(function () {
            var tishi = $("#tishi").text();
            if (tishi == "") {
            } else {
                alert(tishi);
            }
        })
        //注册验证
        function userzhuce() {
            var $loginId = $("#userLoginId").val();
            var $loginPass = $("#userLoginPass").val();
            if ($loginId == "" || $loginPass == "") {
                alert("必须填写登录账号和密码");
                return false;
            } else {
                return true;
            }
        }
        //登陆验证
        function userlogin() {
            var $userName = $("#userName").val();
            var $userPass = $("#userPass").val();
            if ($userName == "" || $userPass == "") {
                alert("请填写完整信息");
                return false;
            }
            return true;
        }
    </script>

    <script type="text/javascript">
        $(function () {
            var nav = $(".header"); //得到导航对象
            var win = $(window); //得到窗口对象
            var sc = $(document);//得到document文档对象。
            win.scroll(function () {
                if (sc.scrollTop() >= 580) {
                    nav.addClass("head-cut");
                    $(".head-cut").fadeIn(500);
                } else {
                    nav.removeClass("head-cut");
                    $(".head-cut").fadeOut(500);
                }
            })
        })
    </script>
    <script type="text/javascript">
        $(function ($) {
            $(".fullSlide").slide({
                titCell: ".hbox ul",
                mainCell: ".box ul",
                effect: "fold",
                mouseOverStop: false,
                autoPlay: true,
                autoPage: true,
                trigger: "click",
                startFun: function (i) {
                    var curLi = jQuery(".fullSlide .bd li").eq(i);
                    if (!!curLi.attr("_src")) {
                        curLi.css("background-image", curLi.attr("_src")).removeAttr("_src")
                    }
                }
            });

        });

    </script>
</div>
</body>
</html>
